<template>
  <div class="homecontent">
    <!-- <img src="../assets/homepage/1.png" alt=""> -->
    <section class="product">
      <div class="title">
        <div class="t-box"></div>
        <div class="t-line"></div>
        <div class="t-text"></div>
      </div>
      <div class="banner">
        <img src="../assets/homepage/home_banner_product.png" alt />
      </div>
    </section>

    <section class="sales">
      <div class="title">
        <div class="t-box"></div>
        <div class="t-line"></div>
        <div class="t-text"></div>
      </div>
      <div class="banner">
        <div class="left">
          <p>关注健康</p>
          <p>
            您的
            <span class="b">体重</span>管理助手
          </p>
          <div class="order">
            <span class="l">售价:￥</span>
            <span class="r">
              970元/大盒
              <em>(24g)</em>
            </span>
            <br />
            <button @click="salesBuy()">立即抢购</button>
          </div>
        </div>
        <div class="right">
          <img src="../assets/homepage/home_banner_sale.jpg" alt />
        </div>
      </div>
    </section>

    <section class="remind">
      <div class="title">
        <div class="t-box"></div>
        <div class="t-line"></div>
        <div class="t-text"></div>
      </div>
      <div class="banner">
        <div class="left">
          <ul>
            <li>
              <i></i>
              本品不含防腐剂，为素片，表面偶有掉粉、有黄色至黑色麻点为原料本身所带，属正常现象。
            </li>
            <li>
              <i></i>
              食用本品产生饱胀感，婴幼儿、儿童、孕产妇、血糖偏低及高危职业等需强调营养均衡的人士不宜食用。
            </li>
            <li>
              <i></i>
              食用魔芋过敏者不宜食用。
            </li>
            <li>
              <i></i>
              本品中圆苞车前子壳富含膳食纤维，易吸水膨胀有粘性，带来饱胀感，不宜嚼食及食用过多。建议每次餐前不超过4g搭配大量水食用，食用次数可根据个人需求而定。
            </li>
          </ul>
        </div>
        <img src="../assets/homepage/remind_img.jpg" alt />
      </div>
    </section>

    <section class="news">
      <div class="title">
        <div class="t-box"></div>
        <div class="t-line"></div>
        <div class="t-text"></div>
      </div>
      <div class="banner">
        <div class="left">
          <ul>
            <li>
              <div class="t">小常识</div>
              <div class="cont">随着生活水平的不断提高，人们的饮食习惯已发生了很大的改变，人们对高热量、高脂肪、高蛋白食品和精细食品的摄入量大大增加...</div>
              <a @click="knowDetail(123)" href="javascript:;">了解详情</a>
            </li>
            <li>
              <div class="t">注册会员</div>
              <div class="t">有机会免费获得</div>
              <div class="t">价值600余元产品</div>
              <!--
              <div class="cont">
                目前肥胖依旧是全球性的健康流行病，大部分消费者的体重超过医学推荐值。从1980年至今……
              </div>
              <a @click="knowDetail()" href="javascript:;">了解详情</a>
              -->
            </li>
          </ul>
        </div>
        <img src="../assets/homepage/news_img.jpg" alt />
      </div>
    </section>

    <section class="member">
      <div class="title">
        <div class="t-box"></div>
        <div class="t-line"></div>
        <div class="t-text"></div>
      </div>
      <div class="banner">
        <div class="t">欢迎注册会员</div>
        <div class="code">
          <img src="../assets/homepage/qrcode.jpg" alt="qrcode">
        </div>
      </div>
    </section>

    <div class="liji" @click="buy()"></div>
    <!-- 首页价格 -->
    <!-- <div class="price">700</div> -->
    <!-- 首页价格 -->
    <!-- 首页小常识 -->
    <!-- <div class="changshi">随着生活水平的不断提高，人们的饮食习惯已发生了很大的改变，人们对高热量、高脂肪、高蛋白食品和精细食品的摄入量大大增加……</div> -->
    <!-- 首页小常识 -->
    <!-- <div class="more"></div> -->
    <!-- 注册会员免费 -->
    <!-- <div class="changshi2">注册会员，您有机会免费获得本公司价值600余元产品。</div> -->
    <!-- 注册会员免费 -->
  </div>
</template>

<script>
export default {
  methods: {
    buy() {
      console.log(1);
    },
    salesBuy() {
      console.log("salesBuy");
      window.open('https://qujiao.tmall.com/', '_blank');
    },
    knowDetail(i) {
      console.log("knowDetail:", i);
      Bus.$emit("topbar", i);
    }
  }
};
</script>

<style lang="scss" scoped>
.b {
  font-weight: bolder;
}
.homecontent {
  width: 100%;
  display: inline-block;
}

section {
  min-height: 200px;
  min-width: 900px;
  margin: 20px 0 50px 0;
  position: relative;
  z-index: 10;

  .title {
    height: 80px;
    vertical-align: middle;
    position: relative;
    margin: 0px 0 30px 0;
    &:before,
    &:after {
      content: "";
      position: absolute;
      width: 6px;
      height: 6px;
      border: 1px solid #c9990c;
      border-radius: 50%;
      top: 45%;
      background: white;
    }
    &:before {
      left: 0;
    }
    &:after {
      right: 0;
    }
  }

  .t-box {
    background: url(../assets/homepage/widget.png) no-repeat 75px 10px;
    width: 350px;
    height: 65px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
  }
  .t-text {
    background: url(../assets/homepage/widget.png) no-repeat 66px -63px;
    width: 350px;
    height: 66px;
    position: absolute;
    top: 26px;
    left: 50%;
    transform: translateX(-50%);
  }
  .t-line {
    height: 1px;
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    z-index: -1;
    background: #c9990c;
  }
  .banner {
    display: inline-block;
  }
  &.product {
    width: 64%;
    margin: 20px auto;
  }
  &.sales {
    width: 64%;
    margin: 20px auto;

    .t-text {
      background-position-y: -144px;
    }
    .banner {
      width: 100%;
      text-align: left;
      white-space: nowrap;
      .left {
        text-align: left;
        color: #c9990c;
        display: inline-block;
        vertical-align: top;
        margin: 30px 0 0 0;
        p {
          font-size: 40px;
        }
        .order {
          font-size: 16px;
          font-weight: bold;
          margin: 60px 0 10px 0;
          button {
            background: #c9990c;
            padding: 2px 10px 5px 10px;
            display: inline-block;
            color: white;
            font-size: 23px;
            text-decoration: none;
            border-radius: 10px;
            margin: 10px 0 0 0;
            cursor: pointer;
            border: 1px solid transparent;
            font-weight: bold;
            outline: none;
            &:hover {
              color: #c9990c;
              border-color: #c9990c;
              background: white;
            }
          }
          .r {
            color: #3c3c3c;
            font-size: 35px;
            em {
              font-size: 16px;
              font-style: normal;
            }
          }
        }
      }
      .right {
        text-align: right;
        display: inline-block;
        width: 77%;
        img {
          width: 730px;
          display: inline-block;
          margin: 50px 0px -50px 0;
        }
      }
    }
  }

  &.remind {
    min-height: 528px;
    .t-text {
      background-position-y: -231px;
    }
    .banner {
      background: url(../assets/homepage/remind_bg.jpg) 0px 0px;
      position: absolute;
      left: -30%;
      top: 40px;
      right: -30%;
      z-index: -2;
      bottom: -91px;
      .left {
        display: inline-block;
        width: 500px;
        vertical-align: top;
        padding: 50px 0 0 0;
        margin: 0 50px 0 0;
        color: #c9990c;
        text-align: left;
        ul {
          list-style: none;
          line-height: 25px;
          li {
            border: 1px solid #c9990c;
            border-radius: 10px;
            margin: 25px 10px;
            padding: 15px 30px;
          }
        }
      }
      img {
        display: inline-block;
        width: 500px;
        margin: 100px 0 0 0;
      }
    }
  }

  &.news {
    min-height: 528px;
    width: 64%;
    margin: 20px auto;

    .t-text {
      background-position-y: -315px;
    }
    .banner {
      position: absolute;
      left: 0;
      top: 40px;
      right: 0;
      z-index: -2;
      text-align: left;
      .left {
        display: inline-block;
        width: 44%;
        vertical-align: top;
        padding: 50px 0 0 0;
        color: #c9990c;
        ul {
          list-style: none;
          line-height: 25px;
          li {

            margin: 25px 10px;
            padding: 15px 0px;
            .t {
              font-size: 24px;
              margin: 0 0 25px 0;
            }
            .cont {
              margin: 0 0 25px 0;
              color: #3c3c3c;
            }
            a {
              &:hover {
                color: #c9990c;
                &:after {
                  background: #c9990c;
                }
              }
              text-decoration: none;
              color: #3c3c3c;
              position: relative;
              &:after {
                content: "";
                left: 73px;
                top: 10px;
                right: 0;
                height: 1px;
                background: #3c3c3c;
                position: absolute;
                width: 250px;
              }
            }
          }
        }
      }
      img {
        display: inline-block;
        width: 500px;
        margin: 100px 0px 0 0;
        float: right;
      }
    }
  }
  &.member {
    min-height: 600px;
    width: 64%;
    margin: 20px auto;

    .t-text {
      background-position-y: -398px;
    }
    .t {
      font-size: 60px;
      font-weight: bold;
      margin: 70px 0px 30px 0px;
    }
    .code {
      // background: url(../assets/homepage/widget.png) no-repeat -313px 0px;
      // width: 180px;
      // height: 247px;
      display: inline-block;
    }
  }
} //endof section

.liji {
  position: absolute;
  width: 130px;
  height: 40px;
  top: 1310px;
  left: 370px;
  cursor: pointer;
}

.price {
  position: absolute;
  width: 65px;
  height: 35px;
  top: 1260px;
  left: 436px;
  line-height: 35px;
  font-size: 38px;
  text-align: right;
  font-weight: bold;
  background-color: white;
}

.changshi {
  position: absolute;
  width: 410px;
  height: 80px;
  top: 2555px;
  left: 358px;
  background-color: white;
  font-weight: 500;
  color: #c9990c;
  cursor: pointer;
  font-size: 15px;
}

.more {
  position: absolute;
  width: 70px;
  height: 30px;
  top: 2650px;
  left: 355px;
  background-color: transparent;
  cursor: pointer;
}

.changshi2 {
  position: absolute;
  width: 410px;
  height: 155px;
  top: 2786px;
  left: 358px;
  background-color: white;
  font-weight: 500;
  color: #c9990c;
  cursor: pointer;
  font-size: 15px;
}

@media screen and (max-width: 640px) {

  section {
    min-width: 200px;
    width: 100% !important;
    box-sizing: border-box;
    margin-bottom: 20px;

    .title {
      transform: scale(0.755);
    }

    &.product {
      .banner {
        img {
          width: 100%;
        }
      }
    }
    &.sales {
      .banner {
        width: 100%;
        position: relative;
        .left {
          width: 100%;
          text-align: center;
          margin-top: 240px;
          p {
            font-size: 22px;
            margin: 16px 0;
          }
          .order {
            margin-top: 10px;
            .r {
              font-size: 26px !important;
            }
            a {
              font-size: 20px;
            }
            button {
              font-size: 20px;
            }
          }
        }
        .right {
          position: absolute;
          top: 0;
          left: 0; right: 0;
          width: 100%;
          text-align: center;
          img {
            width: 100%;
          }
        }
      }
    }
    &.remind {
      min-height: auto;
      padding: 0;
      .banner {
        display: block;
        position: relative;
        left: auto; right: auto;
        top: 0;
        .left {
          margin: 0;
          padding: 0;
          width: 100%;
          ul {
            padding: 0;
            li {
              box-sizing: border-box;
              margin: 8px;
              padding: 12px;
            }
          }
        }
        img {
          display: block;
          margin-top: 0;
          width: 100%;
        }
      }
    }
    &.news {
      .banner {
        display: block;
        position: relative;
        left: auto; right: auto;
        top: 0;
        .left {
          width: 100%;
          box-sizing: border-box;
          padding: 0;
          ul {
            padding: 0;
            margin: 0;
            li {
              margin: 0;
              padding: 12px;
              &:first-child {
                padding-top: 0;
                .t {
                  font-size: 24px;
                  margin-bottom: 24px;
                }
              }
              .t {
                font-size: 16px;
                margin-bottom: 10px;
              }
            }
          }
        }
        img {
          display: block;
          margin-top: 0;
          width: 100%;
          float: none;
          padding: 12px;
          box-sizing: border-box;
        }
      }
    }
    &.member {
      .banner {
        .t {
          font-size: 32px;
          font-weight: normal;
        }
      }
    }
  }
}
</style>
